<template>
  <div id="newsDatails">
  <div class="header_news">
    <div class="head_box">
      <span @click="history"></span>
      政务新闻信息
    </div>
  </div>
  <div class="man_news">
    <div class="wrap_all">
      <div class="man-title">
        <h3>
          {{title}}
        </h3>
        <P>
          <span>{{publishUnit}}</span>
          <span>{{publishDate}}</span>
        </P>
      </div>
      <div class="container">
        <div class="wrap_content" v-html="content">

        </div>
      </div>
    </div>
  </div>
  </div>
</template>
<style >
  .wrap_all{
    padding:0.3rem;
    margin-top:0.9rem;
  }

  .head_box{
    height:0.9rem;
    line-height:0.9rem;
    position:relative;
    font-size:0.32rem;
    text-align: center;
    color:#fff;
  }
  .header_news{

    /*height:0.9rem;*/
    width:100%;
    position:fixed;
    top:0;
    left:0;
    background-color:#ff0033;
    z-index: 99;

    /*line-height:0.9rem;*/
  }
  img {width:100%}
  .header_news span{
    position:absolute;
    left:3%;
    top:50%;
    width:0.25rem;
    height:0.25rem;
    border-right:2px solid #fff;
    border-bottom: 2px solid #fff;
    transform: rotate(135deg) translateX(-50%);
    /*margin-top: -0.125rem;*/
  }
  .man-title{
    margin-bottom:0.5rem;
  }

  .man-title h3{
    font-size:0.48rem;
    margin-bottom:0.25rem;
  }
  .man-title p{
    color:#999;
    font-size:0.18rem;
  }
  .man-title p span{
    color:#999;
    font-size:0.18rem;
  }
  .man-title p span:first-child{
    margin-right:0.3rem;
  }

  .wrap_content *{
    width:100% !important;
    font-size:0.28rem;
    color:#000;
    line-height:0.5rem;
    text-align: justify;
  }
  .wrap_content>p,
  .wrap_content>h3,
  .wrap_content>h3,
  .wrap_content>h3,
  .wrap_content>div,
  .wrap_content>img,
  .wrap_content>span{
    margin-bottom:0.7rem;

  }
</style>
<script>

    export default{
        data(){
            return {
               title:'',
               content:'',
               publishUnit:'',
               publishDate:''
             }
        },
      methods:{
        history(){
          this.$router.go(-1)
        },
        newsDatails(){
          //console.log(this.$route.query.id)
          $.ajax({
            url:'../static/data/newsDatails.json',
            type:'GET',
            data:{
              newsId:this.$route.query.id
            },
            success:(data)=>{
              //console.log(data.title)
              this.content = data.content
              this.title = data.title;
              this.publishUnit= data.publishUnit;
              this.publishDate= data.publishDate;
              //console.log(this.content)
            },
            error(err){

            }
          })
        }
      },
      created(){
        this.newsDatails()
      },
      watch:{

      },
      mounted(){
        console.log(this.title)
      }
    }

</script>
